import React, { Component } from 'react'
import { View,Text, Button } from 'react-native'
import { RootStackNavigation } from '../navigator';

interface IProps {
  navigation: RootStackNavigation
}
export default class Listen extends Component<IProps> {
  onPress = () => {
    const {navigation} = this.props
    // 跳转到指定页面 值只能是RootStackParamList中的属性名称
    // 动态路由
    navigation.navigate('Detail',{id: 100})

  }
  render() {
    this.props;
    return (
      <View>
        <Text>Listen</Text>
        <Button title="跳转到Detail" onPress={this.onPress}></Button>
      </View>
    )
  }
}
